package com.hoppinzq.test;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author ZhangQi
 */
public class demo2 {

    public static void main(String[] args) {
        WebDriver driver = EdgeBrowser.getDriver();
        driver.get("http://150.158.28.40:8806/contact.html");
        WebElement select = driver.findElement(By.tagName("select"));
        List<WebElement> allOptions = select.findElements(By.tagName("option"));
        for (WebElement option : allOptions) {
            System.out.println(String.format("Value is: %s", option.getAttribute("value"))+option.getText()+option.getTagName());
        }

        Select select1 = new Select(driver.findElement(By.tagName("select")));
        select1.deselectAll();
        select1.selectByVisibleText("Edam");
    }
}

